<template>
  <div class='home-banner pr'>
    <Banner :bannerData="bannerData" />
    <UserInfo />
  </div>
</template>
<script>
import Banner from '@/components/banner.vue'
import UserInfo from './userinfo/userInfo.vue'
export default {
  components: {Banner,UserInfo},
  name: "",
  data() {
    return {
      bannerData:[
        {img:require('@/assets/imgs/homepage/banner.jpeg')}
        /*{img:require('@/assets/imgs/homepage/banner.jpeg')}*/
      ]
    };
  },
  methods: {
      init(){
          _g.apiPost('protalHome/banner.do').then(res=>{
              if(res.status == 0){
                  res.data.forEach(data=>{
                      if(data.adName == "顶部广告位"){
                          this.$set(this.bannerData[0],"img",data.pic)
                      }
                  })
              }else {
                  _g.toMessage(res)
              }
          })
      }
  },
  created() {
      this.init()
  }
};
</script>
<style lang="scss" scoped>
.home-banner {
}
</style>